//
//  StaffManagerCell.m
//  New_Runway
//
//  Created by mack on 2018/2/7.
//  Copyright © 2018年 NelsonJ. All rights reserved.
//

#import "StaffManagerCell.h"
#import "UserModel.h"
#import "CrmMailListModel.h"

@interface StaffManagerCell ()
@property (nonatomic, strong) NSIndexPath *index;
@property (weak, nonatomic) IBOutlet UILabel *userName;
@property (weak, nonatomic) IBOutlet UILabel *userPhone;
@property (weak, nonatomic) IBOutlet UIButton *lookAndDelate;

@end

@implementation StaffManagerCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)configData:(id)data indexPath:(NSIndexPath *)indexPath{
    self.index = indexPath;
    UserModel *model = data;
    [self.lookAndDelate setImage:[UIImage imageNamed:@"look"] forState:UIControlStateNormal];
    [self.lookAndDelate setTitle:@"查看" forState:UIControlStateNormal];

    self.userName.text = model.userName;
    self.userPhone.text = model.userMobile;
    
}
-(void)configMailData:(id)data indexPath:(NSIndexPath *)indexPath{
    self.index = indexPath;
    [self.lookAndDelate setImage:[UIImage imageNamed:@"delate"] forState:UIControlStateNormal];
    [self.lookAndDelate setTitle:@"删除" forState:UIControlStateNormal];

    CrmMailListModel *model = data;
    self.userName.text = model.customerName;
    self.userPhone.text = model.customerPhone;
}
- (IBAction)editUserMessage:(id)sender {
    [self routerEventWithName:@"edit" userInfo:@{@"index" : self.index}];
    

}
- (IBAction)lookUserMessage:(id)sender {
    
    [self routerEventWithName:@"look" userInfo:@{@"index" : self.index}];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
